from Signature import *

class ZSS(Signature):
    def __init__(self):
        super(ZSS, self).__init__()

    def key_gen(self):
        x = self.group.random(ZR)
        return {'pk': x * self.g, 'sk': x}

    def signature(self, m, sk):
        return (1 / (self.from_hash(m, ZR) + sk)) * self.g

    def verify(self, m, sig, pk):
        return e(self.from_hash(m, ZR) * self.g + pk, sig) == e(self.g, self.g)

if __name__ == '__main__':
    zss = ZSS()
    zss.test(b'hello world')
